package p08.p0807;

import java.util.Scanner;

/**
 * Created by wy on 7/18/2017.
 * 猜数字游戏
 */
public class Test {

    public static void main(String[] args) {
        //double suiji  = (Math.random())*100+1;
        //int  intsuiji = (int)suiji;
       // int intsuiji = (int) ((Math.random()) * 100) + 1;
        //System.out.println(intsuiji);

        int intsuiji = GuessNumber.getRandomNumber();

        Scanner scanner = new Scanner(System.in);
        int index = 0;
        while (index != intsuiji) {
            System.out.println("In put:");
            index = scanner.nextInt();
            if (index > intsuiji) {
                System.out.println("猜大了！");
            } else if (index < intsuiji) {
                System.out.println("猜小了！");
            } else if (index == intsuiji) {
                System.out.println("恭喜你猜对了！");
                break;
            }
        }
    }


}


